Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to select and launch debug configuration #20979

Merged
merged 7 commits into from
Feb 21, 2017
Merged

Ability to select and launch debug configuration #20979

merged 7 commits into from
Feb 21, 2017

Conversation

michelkaporin
Copy link
Contributor

Adds 'debug' keyword similar to 'task' and 'git' to command palette.

Fixes #16613.

@mention-bot
Copy link

@michelkaporin, thanks for your PR! By analyzing the history of the files in this pull request, we identified @egamma and @alexandrudima to be potential reviewers.

@msftclas
Copy link

Hi @michelkaporin, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.

TTYL, MSBOT;

@isidorn isidorn self-assigned this Feb 21, 2017
@isidorn isidorn added this to the February 2017 milestone Feb 21, 2017
@ICommandService commandService: ICommandService,
@IWorkspaceContextService contextService: IWorkspaceContextService,
@IFileService fileService: IFileService,
@IQuickOpenService quickOpenService: IQuickOpenService
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put private for quickOpenService

return nls.localize('noConfigurationsMatching', "No debug configurations matching");
}

return nls.localize('noConfigurationsFound', "No debug configurations found");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update label to also contain '. Please create a 'launch.json' file.'

@@ -210,6 +211,28 @@ export class RunAction extends StartAction {
}
}

export class LaunchAction extends RunAction {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extend from abstractdebugAction

}

public run(): TPromise<any> {
return TPromise.as(this.quickOpenService.show('debug '));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not wrap as promise

@@ -210,6 +211,28 @@ export class RunAction extends StartAction {
}
}

export class LaunchAction extends RunAction {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to SelectAndStartAction, also change the id, nls.id

@@ -127,6 +128,17 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(EnableAllBreakpointsAc
registry.registerWorkbenchAction(new SyncActionDescriptor(DisableAllBreakpointsAction, DisableAllBreakpointsAction.ID, DisableAllBreakpointsAction.LABEL), 'Debug: Disable All Breakpoints', debugCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(ClearReplAction, ClearReplAction.ID, ClearReplAction.LABEL), 'Debug: Clear Debug Console', debugCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(FocusReplAction, FocusReplAction.ID, FocusReplAction.LABEL), 'Debug: Focus Debug Console', debugCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(LaunchAction, LaunchAction.ID, LaunchAction.LABEL, null, CONTEXT_NOT_IN_DEBUG_MODE), 'Debug: Launch Configuration', debugCategory);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove null and context for now

* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer 'use strict', this is simply ignored

import * as errors from 'vs/base/common/errors';

class DebugEntry extends Model.QuickOpenEntry {
private debugService: IDebugService;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of this privates

return false;
}
// Run selected debug configuration
this.debugService.createProcess(this.configurationName).done(undefined, errors.onUnexpectedError);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do it the other way around


public getResults(input: string): TPromise<Model.QuickOpenModel> {
const configurationNames = this.debugService.getConfigurationManager().getConfigurationNames()
.sort((a, b) => a.localeCompare(b))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not sort

@isidorn isidorn merged commit 95b377f into microsoft:master Feb 21, 2017
@isidorn
Copy link
Contributor

isidorn commented Feb 21, 2017

Looks good, merging in 🍻

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to select and start a launch using keyboard
4 participants